// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
require('es6-promise/auto');
import Vue from 'vue';
import App from './App';
import router from './router';
import ddapi from "./auth/ddapi";
import axios from 'axios';
import { dingTalkM } from "dingtalk-auth";

Vue.prototype.$http = axios;
Vue.prototype.$ddapi = ddapi;
Vue.config.productionTip = false;
Vue.filter('font', function (value, num) {
  if (value.length > num) {
    return value.substr(0, num) + "..."
  } else {
    return value;
  }
})
axios.interceptors.request.use(function (config) {    // 这里的config包含每次请求的内容
  config.headers.Authorization = localStorage.getItem('authorization');
  return config;
}, function (err) {
  return Promise.reject(err);
});
// 全局钩子

new Vue({
  el: '#app',
  router,
  template: '<App/>',
  components: { App }
})
// })




